<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="reportTitle" value="SPC控制线建议值报表" />

<%@ include file="/common/report_head.jsp" %>
<%@ include file="/condition/sartTime_input.html"%>
<%@ include file="/condition/endTime_input.html"%>
<%@ include file="/condition/fab_sumo_must.html"%>
<%@ include file="/condition/line_sumo.html"%>
<%@ include file="/condition/toolg_sumo.html"%>
<%@ include file="/condition/tool_sumo.html"%>
<%@ include file="/condition/collectType_sumo.html"%>
<%@ include file="/condition/reportType_radio.html"%>
<%@ include file="/condition/controlChartGrp_sumo.html"%>
<%@ include file="/condition/controlChart_sumo.html"%>

<%@ include file="/common/report_middle.jsp" %>
<%@ include file="/charts-grid/echarts2.html"%>
<div class="col-md-12" style="height: 420px;">
    <div id="pqGrid"></div>
</div>
<%@ include file="/event/report_event.html"%>
<%@include file="/common/report_end.jsp" %>


<script>
    $(document).ready(function () {
        $("title").text("SPC控制线建议值报表");
        $("label:contains('管制图组:')").addClass("keyCss");
        $("label:contains('管制图:')").addClass("keyCss");

        $('#query_btn').click(function (){
            if($("#controlChartGrpSumo").val() === null || $("#controlChartGrpSumo").val() === '' || $("#controlChartSumo").val() === null || $("#controlChartSumo").val() === ''){
                showErrorDialog("0000002", "管制图组和管制图为必选项"); return false;
            }
            initGridAndChart();
            ajax('/jn-report/report/spc_cl_report.do' ,loadConditionMapData(), true, ajax_successful);

            function ajax_successful(outTrxObj) {
                if(outTrxObj.gridData.length < 1) { showMessengerDialog("数据查询为空"); return false; }

                //Chart图数据赋值
                loadEchartsData(myChart, $("#charts"), outTrxObj.chartsData);

                //grid表格数据
                var colM = [
                    {halign:"center",align:'center', dataIndx: 'grp_name_fk',	    title: '管制图组',	       width: 230,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'grp_no_fk',		    title: '管制图号码',       width: 110,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_name_fk',	    title: '管制图',	       width: 230,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_no_fk',	    title: '管制图号码',       width: 110,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_typ_fk',	    title: '管制图类型',       width: 110,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'col_typ_fk',	    title: '收集类型',	       width: 70,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_group_fk',	    title: '量测名称',	       width: 210,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_ucl',		    title: '上控制线建议值',   width: 120,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_target',	    title: '中心线建议值',     width: 120,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_lcl',		    title: '下控制线建议值',   width: 120,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'rpt_typ_fk',	    title: '时间间隔类型',     width: 130,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_ucl',		    title: '当前上控制线',     width: 120,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_target',	    title: '当前中心线',       width: 120,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_lcl',		    title: '当前下控制线',     width: 120,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_count',	    title: '计算总点数',       width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_b_proc_timestamp', title: '计算范围开始时间', width: 220,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_e_proc_timestamp', title: '计算范围结束时间', width: 220,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'evt_timestamp',	    title: '操作时间',	       width: 220,   editable: false, sortable: true}
                ];
                _pqUtil.f.setColModel($("#pqGrid"), colM);
                _pqUtil.f.seTitle($("#pqGrid"), outTrxObj.gridTitle);
                _pqUtil.f.loadPqGridData($("#pqGrid"), outTrxObj.gridData);
            };
        });

    });
</script>
